$(function () {
    window.onload = function () {
        $('.dg').children().mouseenter(function () {
            $(".navigation").children().children().children().eq(2).css('color', 'red')
        })
        $('.dg').children().mouseleave(function () {
            $(".navigation").children().children().children().eq(2).css('color', '')
        })
        $.ajax({
            url: 'http://localhost:3000/guid/new',
            methode: 'get',
            success: function (res) {
                var str = '';
                $.each(res, function (index, item) {
                    var img = item.img
                    str += "<li>" +
                        "<div>" +
                        "<img src=" + img + ">" +
                        "<p class=p>" + item.text + "</P>" +
                        "<p class=p1><span class=span><img src=../tubiao/zan.png>" + item.like + "</span><span><img src=../tubiao/reply.png>" + item.words
                        + "</p>" +
                        "</div>"
                })
                $(".zuixin ul").html(str);


            }
        })
    }
    $('.dg').children().mouseenter(function () {
        $(this).css('border-bottom', '3px solid red').show();
        $(this).children().css('color', 'red')

    })
    $('.dg').children().mouseleave(function () {
        $(this).css('border-bottom', 'none');
        $(this).children().css('color', '');

    })
})